export function modelListColumns() {
  return [
    {
      title: this.$t('module.modelList.modelName'),
      key: 'name',
      ellipsis: true,
      minWidth: 140
    },
    {
      title: this.$t('module.modelList.modelKey'),
      key: 'key',
      ellipsis: false,
      minWidth: 160
    },
    {
      title: this.$t('module.modelList.description'),
      key: 'description',
      minWidth: 160
    },
    {
      title: this.$t('module.modelList.version'),
      key: 'version',
      minWidth: 40
    },
    {
      title: this.$t('common.createTime'),
      key: 'created',
      minWidth: 140,
      render: (h, params) => {
        return h(
          'span',
          {
            attrs: {
              title: params.row.created
            }
          },
          params.row.created
        )
      }
    },
    {
      title: this.$t('common.operating'),
      align: 'center',
      fixed: 'right',
      width: 200,
      render: (h, params) => {
        return h('RowTools', {
          props: {
            data: [
              {
                type: 'icon',
                icon: 'md-analytics',
                text: this.$t('module.modelList.designModel'),
                handle: () => {
                  this.designModel(params.row)
                }
              },
              {
                type: 'icon',
                icon: 'md-appstore',
                text: this.$t('module.modelList.publishModel'),
                handle: () => {
                  this.publishModel(params.row)
                }
              },
              {
                type: 'icon',
                icon: 'md-create',
                text: this.$t('common.edit'),
                handle: () => {
                  this.editModel(params.row)
                }
              },
              {
                type: 'icon',
                icon: 'ios-trash',
                text: this.$t('common.delete'),
                handle: () => {
                  this._deleteModel(params.row)
                }
              },
              {
                type: 'icon',
                icon: 'md-download',
                text: this.$t('module.modelList.export'),
                handle: () => {
                  this._exportModel(params.row.id)
                }
              },
              {
                type: 'icon',
                icon: 'md-copy',
                text: this.$t('module.modelList.copyModel'),
                handle: () => {
                  this._copyModel(params.row)
                }
              }
            ]
          }
        })
      }
    }
  ]
}
